<extend name="Public:company_center"/>

<block name="right_main">
<style>
	.icon-job-post-step {
		background-size: 965px 31px;
		background-repeat: no-repeat;
		background-position: 25% 0;
		width: 965px;
		height: 31px;
		margin: 0 auto;
	}
</style>
<div class="col-xs-15 col-md-10 wei-user-admin-content"><h3 class="wei-user-admin-title-bar">编辑职位</h3>
	<form class="form-horizontal" method="post" action="{:U('Job/update')}" id="jobForm">
		<input type="hidden" name="id" value="{$Think.get.id}">
		<input type="hidden" name="cid" value="{$data['cid']}">
		<div class="form-group">
			<label class="col-sm-2 control-label">职位分类&nbsp;<span>*</span></label>

			<div class="col-sm-10"><p class="form-control-static">
				<span>{:cateBread($data['cid'])}</span>&nbsp;
				<a href="{:U('Job/selcate?id='.$_GET['id'])}" class="text-primary">重新选择</a></p>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">
				标题党&nbsp;<span>*</span>
			</label>

			<div class="col-sm-5">
				<input class="form-control" type="text" name="title" value="{$data.title}" placeholder="必填"></div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">
				职位名称&nbsp;<span>*</span>
			</label>

			<div class="col-sm-5">
				<input class="form-control" type="text" name="name" value="{$data.name}" placeholder="必填"></div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">
			月薪&nbsp;<span>*</span>
		</label>

			<div class="col-sm-5 form-inline">
				<input class="form-control" style="width:80px;" type="text" name="payid" value="{$data.payid}" placeholder="数字">&nbsp;K&nbsp;
				<span>（1K = 1000元）</span><span class="help-block"></span></div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">招聘人数&nbsp;<span>*</span></label>

			<div class="col-sm-5 form-inline">
				<input class="form-control" style="width: 60px; " type="text" name="num" value="{$data.num}" placeholder="数字">&nbsp;
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">所在城市&nbsp;<span>*</span></label>

			<div class="col-sm-5"><select class="form-control" name="cityid">
				<foreach name="city" item="v">
					<option value="{$v.id}" <eq name="data.cityid" value="$v.id">selected</eq>>{$v.name}</option>
				</foreach>
			</select></div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">最低学历&nbsp;<span>*</span></label>

			<div class="col-sm-5"><select class="form-control" name="eid">
				<foreach name="edu" item="v">
					<option value="{$v.id}" <eq name="data.eid" value="$v.id">selected</eq>>{$v.tagname}</option>
				</foreach>
			</select></div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">最低工作年限&nbsp;<span>*</span></label>

			<div class="col-sm-5"><select class="form-control" name="year">
				<foreach name="year" item="v">
					<option value="{$v.id}" <eq name="data.year" value="$v.id">selected</eq>>{$v.tagname}</option>
				</foreach>
			</select></div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">岗位职责&nbsp;<span>*</span></label>

			<div class="col-sm-8">
				<textarea class="form-control" rows="8" cols="30" name="duty" placeholder="必填（无需包含“岗位职责”、“主要职责”等字样）">{$data.duty}</textarea>
				<span class="help-block">无需包含“岗位职责”、“主要职责”等字样</span>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label" for="requirement">任职要求&nbsp;<span>*</span></label>

			<div class="col-sm-8">
				<textarea class="form-control" rows="8" cols="30" id="requirement" name="request" placeholder="必填（无需包含“任职要求”、“要求”等字样）">{$data.request}</textarea><span class="help-block">无需包含“任职要求”、“要求”等字样</span>
			</div>
		</div>
		<div class="form-group"><label class="col-sm-2 control-label">&nbsp;</label>

			<div class="col-sm-10">
				<button type="submit" class="btn btn-primary">保存</button>
				&nbsp;
				<button type="button" class="btn btn-default" onclick="history.go(-1)">取消</button>
			</div>
		</div>
	</form>

</div>
<script>
	seajs.use(['$', 'bootbox', 'form-ajax'], function () {
		$(function () {
			var ajaxFrom = $('#jobForm');
			ajaxFrom.ajaxForm({
				dataType : 'json',
				success : function (data) {
					if ( data.status > 0 && data.url ) {
						window.location.href = data.url;
					} else {
						bootbox.alert({
							message : data.info,
							title : "提示信息"
						});
						return false;
					}
				}
			})
		})
	});
</script>
</block>